package cn.eng.basic.utils;

import lombok.Data;

/**
 * 封装的 返回结果状态
 */
@Data
public class AjaxResult {
     private String code="200";
     private Boolean success = true;
     private String msg = "操作成功";
     private Object obj;

    public AjaxResult() {
    }

    public AjaxResult(Boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public static AjaxResult me(){
         return new AjaxResult();
     }

    public AjaxResult setObj(Object obj) {
        this.obj = obj;
        return this;
    }

    public AjaxResult setCode(String code) {
        this.code = code;
        return this;
    }

    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }
}
